﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CtrEventEdit.ascx.cs" Inherits="VluSDCEvent.CtrEventEdit" %>
<%@ Register Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" TagPrefix="dnn" %>
<%@ Register Src="~/controls/labelcontrol.ascx" TagName="Label" TagPrefix="dnn" %>
<%@ Register Src="~/controls/texteditor.ascx" TagName="TextEditor" TagPrefix="dnn" %>

<table width="100%">
    <tr>
        <td>
            <table width="100%">
                <tr>
                    <td>
                        <dnn:Label runat="server" ID="lblFrom" ControlName="lblFrom" Text="From"/>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtFromDate" MaxLength="10"></asp:TextBox>
                        <asp:Image ID="CalendarImageFrom" runat="server" ImageUrl="~/Images/Calendar.png" />
                    </td>
                    <td>
                        <dnn:Label runat="server" ID="lblTo" ControlName="lblTo" Text="To" />
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtToDate" MaxLength="10" ></asp:TextBox>
                        <asp:Image ID="CalendarImageTo" runat="server" ImageUrl="~/Images/Calendar.png" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <dnn:TextEditor runat="server" ID="txtContent" Width="100%"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:Label runat="server" ID="lblError" ControlName="lblError" Text="Lỗi." ForeColor="Red" Visible="false"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:Label runat="server" ID="lblEventId" Text="0" Visible="false"></asp:Label>
                        <dnn:CommandButton runat="server" ID="cmbSave" ImageUrl="~/images/save.gif" Text="Save" />
                        &nbsp;&nbsp;
                        <dnn:CommandButton runat="server" ID="cmbCancel" ImageUrl="~/images/rev.gif" Text="Cancel" />
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>
         <asp:DataGrid runat="server" ID="dgrEvent" AutoGenerateColumns="false" 
                DataKeyField="Id" onitemcommand="dgrEvent_ItemCommand" 
                onitemdatabound="dgrEvent_ItemDataBound">
                <Columns>
                    <asp:TemplateColumn>
                        <ItemTemplate>
                            <dnn:CommandButton runat="server" ID="cmbDelete" ImageUrl="~/images/delete.gif" Text="" CommandName="cmbDelete"/>
                            <dnn:CommandButton runat="server" ID="cmbEdit" ImageUrl="~/images/edit.gif" Text="" CommandName="cmbEdit"/>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn>
                        <ItemTemplate>
                            <dnn:CommandButton runat="server" ID="cmbMoveUp" ImageUrl="~/images/action_up.gif" Text="" CommandName="cmbMoveUp"/>
                            <dnn:CommandButton runat="server" ID="cmbMoveDown" ImageUrl="~/images/action_down.gif" Text="" CommandName="cmbMoveDown"/>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn>
                        <HeaderTemplate>
                            <dnn:Label runat="server" ID="lblContentHeader" Text="Sự Kiện" ControlName="lblContentHeader" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblContent" Text='<%# System.Web.HttpUtility.HtmlDecode(Eval("Content").ToString()) %>' />
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn>
                        <HeaderTemplate>
                            <dnn:Label runat="server" ID="lblFromDateHeader" Text="Từ Ngày" ControlName="lblFromDateHeader" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblFromDate" Text='<%# DateTime.Parse(Eval("StartDate").ToString()).ToShortDateString() %>' />
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn>
                        <HeaderTemplate>
                            <dnn:Label runat="server" ID="lblToDateHeader" Text="Đến Ngày" ControlName="lblToDateHeader" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblToDate" Text='<%# DateTime.Parse(Eval("EndDate").ToString()).ToShortDateString() %>' />
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn>
                        <HeaderTemplate>
                            <dnn:Label runat="server" ID="lblCreateByHeader" Text="Người Tạo" ControlName="lblCreateByHeader" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblCreateBy" Text='<%# Eval("ModifiedBy") %>' />
                        </ItemTemplate>
                    </asp:TemplateColumn>
                </Columns>
            </asp:DataGrid>
        </td>
    </tr>
</table>
